package com.xiumu.config.flyway;

import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
public class XiuMuFlywayAutoConfiguration {

    /**
     * 只允许 dev 环境可以修改已经提交的sql文件。
     */
    @Bean
    @Profile("dev")
    public FlywayMigrationStrategy tataFlywayMigrationStrategy() {
        return new XiuMuFlywayMigrationStrategy();
    }
}
